package com.atguigu.domain.task.service;

import com.atguigu.domain.task.model.TaskEntity;
import com.atguigu.domain.task.respository.ITaskRespository;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;

@Service
public class TaskService implements ITaskService{
    @Resource
    private ITaskRespository taskRespository;

    @Override
    public List<TaskEntity> queryNoSendMessageTaskList() {

        return taskRespository.queryNoSendMessageTaskList();
    }

    @Override
    public void updateTaskSendMessageCompleted(String userId, String messageId) {
        taskRespository.updateTaskSendMessageCompleted(userId, messageId);
    }

    @Override
    public void sendMessage(TaskEntity taskEntity) {
        taskRespository.sendMessage(taskEntity);
    }

    @Override
    public void updateTaskSendMessageFail(String userId, String messageId) {
        taskRespository.updateTaskSendMessageFail(userId, messageId);
    }
}
